<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript" charset="utf-8">
var admin_dalog_treegrid;
var admin_dalog_searchForm = undefined;
$(function(){
	admin_dalog_searchForm = $('#admin_dalog_searchForm').form();
	  $("#admin_dalog_searchButton").bind('click', function(){   
		  
		  admin_dalog_search(); 
	    }); 
	  $("#admin_dalog_CleanSearchButton").bind('click', function(){   
		  
		  admin_dalog_cleanSearch();
    }); 
		
	  admin_dalog_treegrid=$('#admin_dalog_treegrid').treegrid({
		url : '${pageContext.request.contextPath}/daLogAction!treegrid.action',
		queryParams:getQueryParams("daId"),  
		title:'指定档案操作信息查询',
		iconCls:'icon-search',
		toolbar : '#admin_dalog_toolbar',
		fit : true,
	    idField:'id',    
	    treeField:'daId',
		rownumbers: true,		//显示行号
		fitColumns : true,		//显示横向滚动条
		pagination : true,
		pageSize : 20,
		pageList : [ 10,20, 30, 40, 50 ],
		sortName:'cjsj',
		sortOrder:'desc',
		columns : [[
					{title:'档案编号',field:'daId',width:100,sortable:true,},
					{title:'申请类别',field:'ztName',width:100,sortable:true,},
					{title:'申请人',field:'addUserName',width:100,sortable:true,},
					{title:'申请信息',field:'bz',width:100,sortable:true,},
					{title:'申请时间',field:'cjsj',width:100,sortable:true,},
					{title:'受理人',field:'editUserName',width:100,sortable:true,},
					{
					title:'受理状态',
					field:'flag',
					width:100,
					sortable:true,
					formatter:function(value){
						if(value == "T"){
							return "已受理";
						}else{
							return "未受理";
						}
					}
					},
					{title:'受理时间',field:'editsj',width:100,sortable:true,},
					{title:'受理信息',field:'bz1',width:100,sortable:true,}
				]],
			});
			
		});
function admin_dalog_search() {
	admin_dalog_treegrid.treegrid("options").queryParams = getQueryParams("daId");  
    autoLoad(admin_dalog_treegrid.treegrid("getPager"),1); 
}
function admin_dalog_cleanSearch() {
	admin_dalog_searchForm.find('input').val('');
	admin_dalog_search();
}
/** 
 * 将指定form参数转换为json对象 
 */  
function getQueryParams(conditionFormId){  
    var searchCondition = getJqueryObjById(conditionFormId).serialize();  
    var obj = {};  
    var pairs = searchCondition.split('&');  
    var name,value;  
      
    $.each(pairs, function(i,pair) {  
        pair = pair.split('=');  
        name = decodeURIComponent(pair[0]);  
        value = decodeURIComponent(pair[1]);  
          
        obj[name] =  !obj[name] ? value :[].concat(obj[name]).concat(value);              //若有多个同名称的参数，则拼接  
    });  
      
    return obj;  
}
/** 
 * 根据id获取jquery对象 
 * @param id 
 */  
function getJqueryObjById(id){  
    return $("#" + id);  
} 
/** 
 * 自动触发分页的加载操作 
 
 * @param pager  各个控件对应的pagination组件 
 */  
function autoLoad(pager,pageNumber){  
    var event = jQuery.Event("keydown");//模拟一个键盘事件          
    event.keyCode = 13;//keyCode=13是回车  
      
    pager.find('input.pagination-num').val(pageNumber); //设置跳转页为当前指定页面  
      
    pager.find('input.pagination-num').trigger(event);  
}  
</script>
<div class="easyui-layout" fit="true">
	<div region="center" border="false" style="overflow: hidden;">
		<div id="admin_dalog_toolbar" class="treegrid-toolbar" style="height: auto;display: none;">
			<fieldset>
				<legend>筛选</legend>
					<form id="admin_dalog_searchForm">
						<table class="admin_dalog_searchForm treegrid-toolbar" style="width: 100%;height: 100%;">
						<tr>
						<td>
						<label>档案编号:&nbsp;</label><input name="daId" id="daId" />
						<a href='javascript:void(0);' id="admin_dalog_searchButton" class='easyui-linkbutton' data-options="iconCls:'icon-search'">查询</a>
						<a href='javascript:void(0);' id="admin_dalog_CleanSearchButton" class='easyui-linkbutton' data-options="iconCls:'icon-cancel'">清空</a>
						</td>
						</tr>
						</table>
					</form>
			</fieldset>
			<!-- <div>
				<a class="easyui-linkbutton" iconCls="icon-sqdy" onclick="admin_dalog_gl(1);" plain="true" href="javascript:void(0);">申请调阅</a>
				<a class="easyui-linkbutton" iconCls="icon-sqrk" onclick="admin_dalog_gl(2);" plain="true" href="javascript:void(0);">申请入库</a>
				<a class="easyui-linkbutton" iconCls="icon-sqsc" onclick="admin_dalog_gl(3);" plain="true" href="javascript:void(0);">申请删除</a>
				<a class="easyui-linkbutton" iconCls="icon-sqxh" onclick="admin_dalog_gl(4);" plain="true" href="javascript:void(0);">申请销毁</a>
				<a class="easyui-linkbutton" iconCls="icon-undo" onclick="admin_dalog_treegrid.treegrid('unselectAll');" plain="true" href="javascript:void(0);">取消选中</a>
			</div> -->
		</div>
		<table id="admin_dalog_treegrid"></table>
	</div>
</div> 

